import BaseService from "../BaseService";

class FileAttachmentInstService extends BaseService {
    uploadFile(params, progressFn, config) {
        return this.postUploadFile(
            this.getModulePath() + `/upload`,
            params,
            progressFn,
            config
        );
    }

    uploadReportFile(params, config) {
        return this.postUploadFile(
            this.getModulePath() + `/uploadReportFIle`,
            params,
            config
        );
    }

    queryList(params) {
        return this.getAction(this.getModulePath() + `/queryList`, params);
    }

    downloadFile(params) {
        return this.getDownloadction(
            this.getModulePath() + `/downloadFile`,
            params
        );
    }

    queryAttByBizNum(params) {
        return this.postAction(
            this.getModulePath() + `/queryAttByBizNum`,
            params
        );
    }

    /**
     * 描述:获取host地址
     * @returns {string}
     */
    getBaseUrl() {
        return this.serviceConfig.getBaseUrl("oauth");
    }

    // 详情查询
    setMain(params) {
        return this.getAction(this.getModulePath() + `/setMain`, params);
    }

    // 详情查询
    delete(params) {
        return this.getAction(this.getModulePath() + `/delete`, params);
    }

    /**
     * 描述:获取模块地址
     * @returns {string}
     */
    getModulePath() {
        return "/file/attachmentInst";
    }
}

export default new FileAttachmentInstService();
